<template>
  <div :class="[modelName,'container-fluid']" >
    <div class="text-left">
        <ListView  ref="listView" :listData="listData" @loadingMoreData="loadData" />
    </div>
    
  </div>
</template>

<script>
import ListView from '@/components/content/ListView'

export default {

    data () {
        return {
            'modelName':'best-blog',
            listData:[],
            lastID:-1,
        }
    },
    components:{
        ListView
    },
    mounted(){ this.init(); },
    methods: {
        init(){
            this.resetData();
            this.loadData();
        },
        resetData(){
            this.lastID = -1;
            this.listData = [];
        },
        loadData(){
            var self = this;
            this.$refs.listView.beginLoading();
            var lastID = self.lastID >= 0 ? self.lastID : 0;
            setTimeout(()=>{
                for(var i=1;i<11;i++){
                    self.listData.push({
                        key:lastID+i,
                        title:'标题'+(lastID+i),
                        content:'内容sdcus合法额潍坊毫不为sdjhjhsjhwejhwj就是大家我叫我交话费是大家好我就会恢复王府井晚饭温柔我发我认为人物我服务日意然后 iu违法芣微积分还未丢违法好晚饭3 34 台风根 给他 4个人沟通被害人头部认同不认同吧'+i,
                        author:'作者',
                        create_date:'2018-01-01',
                        img:'https://upload-images.jianshu.io/upload_images/3570835-fe09eaef00b98e0b.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/300/h/240'
                    });
                }
                self.lastID = self.listData[self.listData.length-1].key;
                self.$refs.listView.finishLoading();
            },1000);
        }
    }
}
</script>

<style>

</style>
